home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 1 of 2).iso / st-samples / fx inst a / text / casio.txt < prev    next >
Encoding:
Text File  |  1987-08-08  |  22.4 KB  |  630 lines

  1. -------------------------------------------------------------------------------
  2. ----------------- CASIO CZ MIDI GUIDE  condensed version ----------------------
  3. -------------------------------------------------------------------------------
  4. ---- or: Everything you Never Wanted to Know about MIDI but are going to ------
  5. ------------------- Find Out Anyway -------------------------------------------
  6. -------------------------------------------------------------------------------
  7.  
  8.         THIS IS AIMED SPECIFICALLY AT CZ101,CZ1000 and CZ5000 OWNERS.
  9.  
  10. NOTE: I beleive the data given to me by Casio to be a) correct, and b) public
  11.         domain ( since they just give it to you if you are persistent enough.
  12.         Please forgive spelling, syntactic, or grammatical errors since I am
  13.         trying to condense the manual as I go along...
  14.  
  15. -------------------------------------------------------------------------------
  16.  
  17. Right, at long last, I have been able to get a reply out of CASIO UK about the
  18. MIDI standards of the CZ series of synthesizers. For those of you who know
  19. how to play your keyboard by remote control from a computer, this will be of
  20. some interest, since it covers transmission of programming information ( both
  21. to and from the CZ ), setting of the controllers you previously couldn't access
  22. like tone mix level, and other bits besides.
  23.  
  24. First off, let's recap on the simple stuff. The MIDI is a digital interface to
  25. musical instruments, and relies on serial transmission of data. These data are
  26. usually talked of in terms of bytes, and I shall be using hexadecimal numbers
  27. in this posting.
  28.  
  29. There are basically two types of bytes sent over MIDI - control bytes and data
  30. bytes. Control bytes are distinguished by having values over 0x80 ( 80 hex, 
  31. 128 decimal ), and these have valious meanings:
  32.  
  33. 1) NOTE ON
  34. ----------
  35.  
  36. A note on message consists of sending a "NOTE ON" control byte, the note number
  37. you want to turn on, and the velocity at which you want to play the note. The
  38. note on control is 90 plus the channel number. So, for example, if you want to
  39. play note 32 ( = hex 20) at speed 64 (= hex 40), on the midi instrument receiv-
  40. ing on channel two, then you would send:
  41.  
  42.         92              20              40
  43. NOTE ON, channel 2      Note #32        Velocity 64
  44.  
  45. If you wish to turn two or more notes on at the same time, the control byte
  46. need not be retransmitted. Eg to turn note 35 on as well, you could send
  47.  
  48.         92      20      40      23      40
  49. NOTE ON, ch2    ---32 on--      ---35 on--
  50.  
  51. These codes can be transmitted both ways on all the CZ 101,1000,5000, but since
  52. they do not detect note velocity, it is always transmitted and recognized as
  53. 64 (= 40 hex).
  54.  
  55. 2) NOTE OFF
  56. -----------
  57.  
  58. Just send a note on message with velocity 0. Eg to turn note 35 off, send
  59.  
  60.         92      23      00
  61. NOTE ON,Ch 2    --35 off--
  62.  
  63.  
  64. 3) CONTROL CHANGE
  65. -----------------
  66. There are several controls that can be set from MIDI. Just send a "CONTROL CH"
  67. byte , which is B0 plus the channel number, the number of the control that you
  68. wish to change, then the value you wish to set it to. Eg for CZ101 portamento
  69. time, send
  70.  
  71.         B0      05      10
  72. CONTROL, ch 0   --ctrl 5=16--
  73.  
  74. The controls are:
  75.  
  76. CZ101/1000
  77.  
  78. 01      Vibrato on/off          Send 0 for off, 7F for ON
  79. 05      Portamento time         Send number 00..63 (0..99)
  80. 06      Master tune             Send number 00..7F
  81. 41      Portamento on/off       Send 0 for OFF, 7F for ON
  82.  
  83. CZ5000
  84.  
  85. 01      Modulation wheel        Send number 00..7F
  86. 05      Portamento time         Send number 00..63
  87. 06      Master tune             Send number 00..7F
  88. 40      Sustain pedal           Send 0 for OFF, 7F for ON
  89. 41      Portamento on/off       Send 0 for OFF, 7F for ON
  90.  
  91. 4) PROGRAM CHANGE
  92. -----------------
  93. This allows you to change between the preset sounds ( and your internal
  94. sounds and cartridges ). Just send C0 plus the channel number, then the
  95. program number. Eg to set CZ101 on channel 1 to Synth Bass:
  96.  
  97.         C1              07
  98. PROGRAM ch 1            Program 7
  99.  
  100. Note that the preset tones are given numbers :
  101.  
  102. CZ101/1000
  103.  
  104. 0..0F   Preset sounds 1..16
  105. 20..2F  Internal sounds 1..16
  106. 40..4F  Cartridge sounds 1..16
  107.  
  108. CZ5000
  109.  
  110. 00..1F  Preset sounds A1,A2,A3....D6,D7,D8
  111. 20..3F  Internal sounds A1,A2.....D6,D7,D8
  112.  
  113.  
  114. 5) PITCH BEND CHANGE
  115. --------------------
  116.  
  117. This is acheived by sending E0 plus the channel number, then two bytes 
  118. denoting the new value of pitch bend. The first byte is the most significant,
  119. and the second the least significant. Note also that the lower 6 bits of the
  120. lower byte are not used, and that the central position of the wheel corres-
  121. ponds to the byte sequence 40 00.
  122.  
  123.         HIGHEST         7F 40
  124.  
  125.         HIGHER
  126.  
  127.         CENTER          40 00
  128.  
  129.         LOWER
  130.  
  131.         LOWEST          00 00
  132.  
  133.  
  134. So, to bend the instrument on channel two UP by about half its maximum amount,
  135. send
  136.  
  137.         E2              60      00
  138. BEND channel two        ---1/2 up--
  139.  
  140.  
  141. 6) AFTER TOUCH
  142. --------------
  143. Is not supported on the CZ101/1000/5000. Sorry!
  144.  
  145. 7) MODE CHANGE
  146. --------------
  147. This is very similar to the CONTROL CHANGE message, and can be regarded as a
  148. special case. 
  149.  
  150. OMNI ON         send E0 + channel, 7D, 00
  151. OMNI OFF        send B0 + channel, 7C, 00
  152. POLY ON         send B0 + channel, 7F, 00
  153. POLY OFF        send B0 + channel, 7E, 00
  154.  
  155. OMNI mode plays any MIDI data received at the MIDI IN plug on the back of
  156. the machine, regardless of channel. POLY mode is equivalent to the SOLO button
  157. on the front panel. With the CZ101, for instance, POLY OFF ( =SOLO ) allows
  158. the synth to be used as four monophonic synthesizers under remote control.
  159.  
  160. LOCAL ON        send B0 + channel, 7A, 7F
  161. LOCAL OFF       send B0 + channel, 7A, 00
  162.  
  163. Local mode means that the keyboard is "connected" to the sound producing 
  164. part of the CZ within the machine itself. With LOCAL ON ( the default setting ),
  165. playing the keyboard both sends note messages out of the MIDI port, and also
  166. makes sounds at the same time. If you want to do wierd things like keyboard
  167. splitting, LOCAL OFF will allow you to see what the keyboard is doing without
  168. the CZ making any sound at all. You could then act on that information and send
  169. the keyboard a command depending on the keys that has nothing to do with them,
  170. eg program change or pitch bend. The possibilities are endless !
  171.  
  172.  
  173. SEQUENCER MESSAGES
  174. ------------------
  175. The CZ5000 has its own internal sequencer, which can be controlled by:
  176.  
  177. F8      Clock byte: transmitted 24 times per quarter note ( crotchet )
  178. FA      Start: same as pressing the PLAY button on the front panel
  179. FB      Continue: continue song where last stopped
  180. FC      Stop: stops song play at current position
  181. FD      Active sense: basically, a cry of "Is there anybody out there". If no
  182.         reply is received within about 1/3 second, it shuts the voice off.
  183.  
  184.  
  185. SYSTEM EXCLUSIVE MESSAGES
  186. -------------------------
  187.  
  188. At last, the really meaty stuff. :-)
  189.  
  190. These all have the basic form:
  191.  
  192.         F0      machine ID      some bytes      F7
  193. SYS EX MESSG    YES, YOU        DO THIS         END OF SYS EX
  194.  
  195. Ok, so not very specific, bu that was deliberate to allow manufacturers to use
  196. all the lovely bells and whistles they put on their machine over the MIDI !
  197.  
  198. Since these are usually controlled by computer, I have set them out as a
  199. computer/synthesizer dialogue. Note that the computer MUST wait for replies
  200. before proceding, or all will fail !
  201.  
  202. Here we go, then 
  203.  
  204. 1) SET BEND RANGE
  205. -----------------
  206.  
  207. Computer:       F0 44 00 00 70+channel 40 data F7
  208.  
  209. Eg to set bend range to 8 on channel 4, send
  210.                 F0 44 00 00 74 40 08 F7
  211.  
  212. 2) KEY TRANSPOSE
  213. ----------------
  214.  
  215. Computer:       F0 44 00 00 70+channel 41 data F7
  216.  
  217. Data is as follows:
  218. Key:    G  A  A# B  B# C  C# D  E  E# F  F#
  219. Data:   45 44 43 41 41 00 01 02 03 04 05 06
  220.  
  221. Eg to set key on channel 0 to C#, send
  222.                 F0 44 00 00 70 41 01 F7
  223.  
  224. 3) TONE MIX
  225. -----------
  226.  
  227. Computer:       F0 44 00 00 70+channel 42 data F7
  228.  
  229. The data is 00 to turn tone mix off, or 41..49 for mix level 1..9
  230.  
  231. Eg to set tone mix on channel 0 to 7, send
  232.                 F0 44 00 00 70 42 47 F7
  233.  
  234. 4) ASK ABOUT PROGRAMMER ( Send request 2 )
  235. -----------------------
  236.  
  237. Computer:       F0 44 00 00 70+channel 19 00
  238. CZ101/1000:     F0 44 00 00 70+channel 30
  239. Computer:       70+channel 31
  240. CZ101/1000:     data1 data2 F7
  241. Computer:       F7
  242.  
  243. data1 is the program selected ( see PROGRAM CHANGE )
  244. data2 returns the vibrato/portamento on/off setting:
  245.  
  246. data2   00      10      20      30
  247. Vibrato OFF     OFF     ON      ON
  248. Port'o  OFF     ON      OFF     ON
  249.  
  250. Eg an exchange such as
  251. Computer:       F0 44 00 00 70 19 00            "Want data on channel 0"
  252. CZ101:          F0 44 00 00 70 30               "Gotcha.. data ready"
  253. Computer:       70 31                           "Ok, give it to me"
  254. CZ101:          27 30 F7                        "Internal 8, v on, p on"
  255. Computer:       F7
  256.  
  257. REMOTE PROGRAMMING
  258. ------------------
  259. The send request 1 and receive request 1 messages.
  260.  
  261. These dump a lot of data across the MIDI, which is the same for both messages,
  262. except that the data go the other way. The exchanges are:
  263.  
  264. Send request
  265. Computer:       F0 44 00 00 70+channel 10 program
  266. CZ101/1000:     F0 44 00 00 70+channel 30
  267. Computer:       70+channel 31
  268. CZ101/1000:     <tone data> F7
  269. Computer:       F7
  270.  
  271. Receive request
  272. Computer:       F0 44 00 00 70+channel 20 program
  273. CZ101/1000:     F0 44 00 00 70+channel 30
  274. Computer:       <tone data> F7
  275. Cz101/1000:     F7
  276.  
  277. The program byte is the same as that set by the PROGRAM CHANGE function, with
  278. the addition that you can request the temporary sound area as well ( number is
  279. 60 ). This is the area that is used if you have altered a preset and not saved
  280. it into internal memory.
  281.  
  282. <tone data> is a sequence of 256 bytes containing a LOT of info. Now Casio have
  283. done a lot of funny things with these, like splitting bytes in half and encoding
  284. things in wierd ways so please bear with me.
  285.  
  286. To keep everything this side of infinite length, I shall adopt the same strategy
  287. as the manual, which is to write data in bytes, although they are transmitted
  288. in half- bytes. For example, me writing a byte as 5F requires you to transmit or
  289. receive as 0F 05 ( wierd, huh ? ). This will obvoiusly save a lot of space.
  290.  
  291. So, here goes again :-)
  292.  
  293. There are 25 distinct sections within <tone data>
  294.  
  295. Sec#    Length  Symbol          Contents
  296.         (bytes)
  297.  
  298. 1       1       pflag           line select data, octave range
  299. 2       1       pds             detune up or down
  300. 3       2       pdl,pdh         detune range
  301. 4       1       pvk             vibrato wave number
  302. 5       3       pvdld,pvdlv     vibrato delay time
  303. 6       3       pvsd,pvsv       vibrato rate
  304. 7       3       pvdd,pvdv       vibrato depth
  305. 8       2       mfw             dco1 waveform
  306. 9       2       mamd,mamv       dca1 key follow
  307. 10      2       mwmd,mwmv       dcw1 key follow
  308. 11      1       pmal            end step number of dca1 envelope
  309. 12      16      pma             dca1 envelope rate/level
  310. 13      1       pmwl            end step number of dcw1 envelope
  311. 14      16      pmw             dcw1 envelope rate/level
  312. 15      1       pmpl            end step number of dco1 envelope
  313. 16      16      pmp             dco1 envelope rate/level
  314. 17      2       sfw             dco2 waveform
  315. 18      2       samd,samv       dca2 key follow
  316. 19      2       swmd,swmv       dcw2 key follow
  317. 20      1       psal            end step number of dca2 envelope
  318. 21      16      psa             dca2 rate/level
  319. 22      1       pswl            end step number of dcw2 envelope
  320. 23      16      psw             dcw2 rate/level
  321. 24      1       pspl            end step number of dco2 envelope
  322. 25      16      psp             dco2 rate/level
  323.  
  324. 1) PFLAG
  325. Looking at bits,
  326.         0000  00   00
  327.  Not used^   OCTV  LS
  328.  
  329. OCTV controls octave range: 00=octave 0, 01=+1, 10=-1
  330.  
  331. LS is the line select: 00=1, 01=2, 10=1+1', 11=1+2'
  332.  
  333. So, fo Octave +1, line select 1+1', PFLAG=00000110 = 06
  334.  
  335. 2)PDS
  336. For detune +, PDS is 0, for detune - it is 01
  337.  
  338. 3)PDETL,PDETH
  339.  
  340. Two bytes controlling the depth of the detune.
  341. The first byte is the FINE data.
  342.  
  343. FINE:   0..15   16..30  31..45  46..60
  344. Byte:   00..0F  11..1F  21..2F  31..3F
  345.  
  346. The second contains both the octave and note data:
  347.  
  348. OCT:    0       1       2       3
  349. NOTE:   0..11   0..11   0..11   0..11
  350. Byte:   00..0B  0C..17  18..23  24..2F
  351.  
  352.  
  353. 4) PVK
  354.  
  355. This is the vibrato wave number, encoded as follows
  356.  
  357. WAVE NUMBER:    1       2       3       4
  358. Byte:           08      04      20      02
  359.  
  360. 5) PVDLD,PVDLV
  361.  
  362. This is the vibrato delay time, transmitted in three bytes.
  363.  
  364. Delay   Bytes           Delay   Bytes           Delay   Bytes
  365. 25      19 00 19        50      32 00 4B        75      4B 00 DF
  366. 26      1A 00 1A        51      33 00 4F        76      4C 00 E7
  367. 27      1B 00 1B        52      34 00 53        77      4D 00 EF
  368. 28      1C 00 1C        53      35 00 57        78      4E 00 F7
  369. 29      1D 00 1D        54      36 00 5B        79      4F 00 FF
  370. 30      1E 00 1E        55      37 00 5F        80      50 01 0F
  371. 31      1F 00 1F        56      38 00 63        81      51 01 1F
  372. 32      20 00 21        57      39 00 67        82      52 01 2F
  373. 33      21 00 23        58      3A 00 6B        83      53 01 3F
  374. 34      22 00 25        59      3B 00 6F        84      54 01 4F
  375. 35      23 00 27        60      3C 00 73        85      55 01 5F
  376. 36      24 00 29        61      3D 00 77        86      56 01 6F
  377. 37      25 00 2B        62      3E 00 7B        87      67 01 7F
  378. 38      26 00 2D        63      3F 00 7F        88      58 01 8F
  379. 39      27 00 2F        64      40 00 87        89      59 01 9F
  380. 40      28 00 31        65      41 00 8F        90      5A 01 AF
  381. 41      29 00 33        66      42 00 97        91      5B 01 BF
  382. 42      2A 00 35        67      43 00 9F        92      5C 01 CF
  383. 43      2B 00 37        68      44 00 A7        93      5D 01 DF
  384. 44      2C 00 39        69      45 00 AF        94      5E 01 EF
  385. 45      2D 00 3B        70      46 00 B7        95      5F 01 FF
  386. 46      2E 00 3D        71      47 00 BF        96      60 02 1F
  387. 47      2F 00 3F        72      48 00 C7        97      61 02 3F
  388. 48      30 00 43        73      49 00 CF        98      62 02 5F
  389. 49      31 00 47        74      4A 00 D7        99      63 02 7F
  390.  
  391. For delays in the range 0..31, just transmit 00..1F, 00, 00..1F eg for delay
  392. of 12, send 0C 00 0C. This is convenient since it saves me typing in another
  393. column of boring numbers ;-)
  394.  
  395. 6) PVSD,PVSV
  396.  
  397. Again, here comes another table for conversions. The first column (0..24) is
  398. omitted since the only difficult thing needed is to add 01 00 20 to each entry
  399. ( The first few go 00 00 20, 01 00 40, 02 00 60, ... 06 00 E0, 07 01 00, ..)
  400.  
  401. Rate    Bytes           Rate    Bytes           Rate    Bytes
  402. 25      19 03 40        50      32 09 E0        75      4B 1C E0
  403. 26      1A 03 60        51      33 0A 60        76      4C 1D E0
  404. 27      1B 03 80        52      34 0A E0        77      4D 1E E0
  405. 28      1C 03 A0        53      35 0B 60        78      4E 1F E0
  406. 29      1D 03 C0        54      36 0B E0        79      4F 20 E0
  407. 30      1E 03 E0        55      37 0C 60        80      50 23 E0
  408. 31      1F 04 00        56      38 0C E0        81      51 25 E0
  409. 32      20 04 60        57      39 0D 60        82      52 27 E0
  410. 33      21 04 A0        58      3A 0D E0        83      53 29 E0
  411. 34      22 04 E0        59      3B 0E 60        84      54 2B E0
  412. 35      23 05 20        60      3C 0E E0        85      55 2D E0
  413. 36      24 05 60        61      3D 0F 60        86      56 2F E0
  414. 37      25 05 A0        62      3E 0F E0        87      57 31 E0
  415. 38      26 05 E0        63      3F 10 60        88      58 33 E0
  416. 39      27 06 20        64      40 11 E0        89      59 35 E0
  417. 40      28 06 60        65      41 12 E0        90      5A 37 E0
  418. 41      29 06 A0        66      42 13 E0        91      5B 39 E0
  419. 42      2A 06 E0        67      43 14 E0        92      5C 3B E0
  420. 43      2B 07 20        68      44 15 E0        93      5D 3D E0
  421. 44      2C 07 60        69      45 16 E0        94      5E 3F E0
  422. 45      2D 07 A0        70      46 17 E0        95      5F 41 E0
  423. 46      2E 07 E0        71      47 18 E0        96      60 47 E0
  424. 47      2F 08 20        72      48 19 E0        97      61 4B E0
  425. 48      30 08 E0        73      49 1A E0        98      62 4F E0
  426. 49      31 09 60        74      4A 1B E0        99      63 53 E0
  427.  
  428. 7) PVDD,PVDV
  429.  
  430. These are again encoded as three bytes in a most obscure way. Below 32, the
  431. encoding is 00..1F, 00, 01..20 eg for depth 13, send 0D 00 0E.
  432.  
  433. Depth   Bytes           Depth   Bytes           Depth   Bytes
  434. 25      19 00 1A        50      32 00 4F        75      4B 00 E7
  435. 26      1A 00 1B        51      33 00 53        76      4C 00 EF
  436. 27      1B 00 1C        52      34 00 57        77      4D 00 F7
  437. 28      1C 00 1D        53      35 00 5B        78      4E 00 FF
  438. 29      1D 00 1E        54      36 00 5F        79      4F 01 07
  439. 30      1E 00 1F        55      37 00 63        80      50 01 1F
  440. 31      1F 00 20        56      38 00 67        81      51 01 2F
  441. 32      20 00 23        57      39 00 6B        82      52 01 3F
  442. 33      21 00 25        58      3A 00 6F        83      53 01 4F
  443. 34      22 00 27        59      3B 00 73        84      54 01 5F
  444. 35      23 00 29        60      3C 00 77        85      55 01 6F
  445. 36      24 00 2B        61      3D 00 7B        86      56 01 7F
  446. 37      25 00 2D        62      3E 00 7F        87      57 01 8F
  447. 38      26 00 2F        63      3F 00 83        88      58 01 9F
  448. 39      27 00 31        64      40 00 8F        89      59 01 AF
  449. 40      28 00 33        65      41 00 97        90      5A 01 BF
  450. 41      29 00 35        66      42 00 9F        91      5B 01 CF
  451. 42      2A 00 37        67      43 00 A7        92      5C 01 DF
  452. 43      2B 00 39        68      44 00 AF        93      5D 01 EF
  453. 44      2C 00 3B        69      45 00 B7        94      5E 01 FF
  454. 45      2D 00 3D        70      46 00 BF        95      5F 02 0F
  455. 46      2E 00 3F        71      47 00 C7        96      60 02 3F
  456. 47      2F 00 41        72      48 00 CF        97      61 02 5F
  457. 48      30 00 47        73      49 00 D7        98      62 02 7F
  458. 49      31 00 4B        74      4A 00 DF        99      63 03 00
  459.  
  460. 8) MFW
  461.  
  462. These two bytes transmit the waveform for DCO1, and also the modulation ie
  463. ring, noise or none.
  464.  
  465.                 First byte      Second byte
  466.                 000 000 0  0  00 000 000
  467.  
  468. First=1         000        0  00
  469. Fisrt=2         001        0  00
  470. First=3         010        0  00
  471. First=4         100        0  00
  472. First=5         101        0  00
  473. First=6         110        0  01
  474. First=7         110        0  10
  475. First=8         110        0  11
  476. Second=1            000 1  0  00
  477. Second=2            001 1  0  00
  478. Second=3            010 1  0  00
  479. Second=4            100 1  0  00
  480. Second=5            101 1  0  00
  481. Second=6            110 1  0  01
  482. Second=7            110 1  0  10
  483. Second=8            110 1  0  11
  484. NO MODULATION                    000
  485. RING MODULATION                  100
  486. NOISE MODULATION                 011
  487.  
  488. So, for instance, to set first = 4, second= 2, ring modulation, we have
  489.  
  490.         100 001 1 0 00 100 000 = 1000 0110 0010 0000 = 86 20
  491.  
  492. 9) MAMD,MAMV
  493.  
  494. These two bytes set the DCA1 key follow:
  495.  
  496. Key follow:     0   1   2   3   4   5   6   7   8   9
  497. 1st byte:       00  01  02  03  04  05  06  07  08  09
  498. 2nd byte:       00  08  11  1A  24  2F  3A  45  52  5F
  499.  
  500.  
  501. 10) MWMD, MWMV
  502.  
  503. These two bytes set the DCW1 key follow
  504.  
  505. Key follow:     0   1   2   3   4   5   6   7   8   9
  506. 1st byte:       00  01  02  03  04  05  06  07  08  09
  507. 2nd byte:       00  1F  2C  39  46  53  60  6E  92  FF
  508.  
  509.  
  510. 11) PMAL
  511.  
  512. This sets the position of the end step on DCA1. Step 1..8 gives bytes 00..07.
  513.  
  514. 12) PMA
  515.  
  516. This consists of 8 repetitions of Rate,Level.
  517.  
  518. Given that you wish to set rate r, the data you need to send is
  519.  
  520.         Byte= 119 x r
  521.               -------
  522.                 99
  523. Conversely, if byte=0, rate=0, if byte=7F, rate=99, otherwise
  524.  
  525.         r=99 x byte
  526.           --------- + 1
  527.              119
  528.  
  529. Add 80 hex if the level will be coming down on this step.
  530.  
  531. The level goes up linearly, with 0 being 00, up to 99 is 7F, so that
  532.  
  533.         Byte= 127 x level
  534.               -----------
  535.                  99
  536.  
  537. and     Level= 99 x byte
  538.                --------- + 1
  539.                   127
  540.  
  541. except at byte=0 where level=0, and byte=127, where level=99
  542.  
  543. In all these conversions, fractional parts are ignored, so a result of
  544. byte=24.6987 would be taken as byte=24.
  545.  
  546. 13) PMWL
  547.  
  548. End step number for DCW1. Same as PMAL
  549.  
  550.  
  551. 14) PMW
  552.  
  553. This sets the steps in DCW1, and consists of 8 repetitions of Rate,Level.
  554. The format is similar to PMA, so that you add 80 ( 128 dec ) to the rate if
  555. the level is coming down this step, and that you add 80 to the level if you
  556. wish to set a sustain point. The level data is handled the same as PMA, but 
  557. for some strange reason the rate data is encoded differently.
  558.  
  559. So      byte= 119 x level
  560.               ----------- + 8
  561.                   99
  562.  
  563. and     level= 99 x (byte-8)
  564.                ------------- +1
  565.                     119
  566.  
  567. except where byte=8, level=0, and where byte=77, level=99
  568.  
  569. 15) PMPL
  570.  
  571. Another end step setting, this time for DCO1. Same as PMAL and PMWL
  572.  
  573. 16) PMP
  574.  
  575. Another envelope setting, this time for the DCO1 rates and levels. Again uses a
  576. completely different encoding scheme.
  577.  
  578.         byte= 127 x rate
  579.               ----------
  580.                   99
  581. and
  582.         rate= 99 x byte
  583.               --------- + 1
  584.                  127
  585.  
  586. except where byte=00, rate=0, where byte=7F, rate=99
  587.  
  588. For the level, level data 0..63 translate as bytes 00..3F, and level data
  589. 64..99 translate as bytes 44..67.
  590.  
  591. 17) SFW
  592.  
  593. These two bytes set the waveform for DCO2. They use the same format as MFW
  594. does for DCO1, except that the modulation bits are ignored ( it is best to set
  595. these bits to zero , just in case ).
  596.  
  597. 18) SAMD,SAMV
  598. 19) SWMD,SWMV
  599. 20) PSAL
  600. 21) PSA
  601. 22) PSWL
  602. 23) PSW
  603. 24) PSPL
  604. 25) PSP
  605.  
  606. All the above use the same formats as their counterparts for the first set of
  607. DCO,DCW,DCA, and perform exactly the same functions on the DCA2,DCW2,and DCO2.
  608.  
  609.  
  610.  
  611. This concludes what I hope has been an informative article ( if rather a long
  612. one :-)  ). 
  613.  
  614. Thong
  615.  
  616.  
  617.  
  618.  
  619. [ The views above are my own (except any quotes !) and not anyone elses.. so   ]
  620. [ flame me personally, not them                                                ]
  621. +------------------------------------------------------------------------------+
  622. |                                                                              |
  623. |   "Thong" Ellis, Reading University Computer Science VAX "Sage", England     |
  624. |                                                                              |
  625. |     "But there aren't any REAL people here at all..." : Roosta               |
  626. |                                                                              |
  627. +------------------------------------------------------------------------------+
  628.  
  629.  
  630.